Optimal. Leaf size=235 \[ -\frac {\left (4 a^2-25 b^2\right ) \sin (c+d x) (a+b \cos (c+d x))^3}{120 b d}-\frac {a \left (4 a^2-53 b^2\right ) \sin (c+d x) (a+b \cos (c+d x))^2}{120 b d}-\frac {a \left (4 a^4-121 a^2 b^2-128 b^4\right ) \sin (c+d x)}{60 b d}-\frac {\left (8 a^4-178 a^2 b^2-75 b^4\right ) \sin (c+d x) \cos (c+d x)}{240 d}+\frac {1}{16} x \left (8 a^4+36 a^2 b^2+5 b^4\right )+\frac {\sin (c+d x) (a+b \cos (c+d x))^5}{6 b d}-\frac {a \sin (c+d x) (a+b \cos (c+d x))^4}{30 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.32, antiderivative size = 235, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2791, 2753, 2734} \[ -\frac {a \left (-121 a^2 b^2+4 a^4-128 b^4\right ) \sin (c+d x)}{60 b d}-\frac {\left (4 a^2-25 b^2\right ) \sin (c+d x) (a+b \cos (c+d x))^3}{120 b d}-\frac {a \left (4 a^2-53 b^2\right ) \sin (c+d x) (a+b \cos (c+d x))^2}{120 b d}-\frac {\left (-178 a^2 b^2+8 a^4-75 b^4\right ) \sin (c+d x) \cos (c+d x)}{240 d}+\frac {1}{16} x \left (36 a^2 b^2+8 a^4+5 b^4\right )+\frac {\sin (c+d x) (a+b \cos (c+d x))^5}{6 b d}-\frac {a \sin (c+d x) (a+b \cos (c+d x))^4}{30 b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2734
Rule 2753
Rule 2791
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+b \cos (c+d x))^4 \, dx &=\frac {(a+b \cos (c+d x))^5 \sin (c+d x)}{6 b d}+\frac {\int (5 b-a \cos (c+d x)) (a+b \cos (c+d x))^4 \, dx}{6 b}\\ &=-\frac {a (a+b \cos (c+d x))^4 \sin (c+d x)}{30 b d}+\frac {(a+b \cos (c+d x))^5 \sin (c+d x)}{6 b d}+\frac {\int (a+b \cos (c+d x))^3 \left (21 a b-\left (4 a^2-25 b^2\right ) \cos (c+d x)\right ) \, dx}{30 b}\\ &=-\frac {\left (4 a^2-25 b^2\right ) (a+b \cos (c+d x))^3 \sin (c+d x)}{120 b d}-\frac {a (a+b \cos (c+d x))^4 \sin (c+d x)}{30 b d}+\frac {(a+b \cos (c+d x))^5 \sin (c+d x)}{6 b d}+\frac {\int (a+b \cos (c+d x))^2 \left (3 b \left (24 a^2+25 b^2\right )-3 a \left (4 a^2-53 b^2\right ) \cos (c+d x)\right ) \, dx}{120 b}\\ &=-\frac {a \left (4 a^2-53 b^2\right ) (a+b \cos (c+d x))^2 \sin (c+d x)}{120 b d}-\frac {\left (4 a^2-25 b^2\right ) (a+b \cos (c+d x))^3 \sin (c+d x)}{120 b d}-\frac {a (a+b \cos (c+d x))^4 \sin (c+d x)}{30 b d}+\frac {(a+b \cos (c+d x))^5 \sin (c+d x)}{6 b d}+\frac {\int (a+b \cos (c+d x)) \left (3 a b \left (64 a^2+181 b^2\right )-3 \left (8 a^4-178 a^2 b^2-75 b^4\right ) \cos (c+d x)\right ) \, dx}{360 b}\\ &=\frac {1}{16} \left (8 a^4+36 a^2 b^2+5 b^4\right ) x-\frac {a \left (4 a^4-121 a^2 b^2-128 b^4\right ) \sin (c+d x)}{60 b d}-\frac {\left (8 a^4-178 a^2 b^2-75 b^4\right ) \cos (c+d x) \sin (c+d x)}{240 d}-\frac {a \left (4 a^2-53 b^2\right ) (a+b \cos (c+d x))^2 \sin (c+d x)}{120 b d}-\frac {\left (4 a^2-25 b^2\right ) (a+b \cos (c+d x))^3 \sin (c+d x)}{120 b d}-\frac {a (a+b \cos (c+d x))^4 \sin (c+d x)}{30 b d}+\frac {(a+b \cos (c+d x))^5 \sin (c+d x)}{6 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.44, size = 156, normalized size = 0.66 \[ \frac {45 b^2 \left (4 a^2+b^2\right ) \sin (4 (c+d x))+480 a b \left (6 a^2+5 b^2\right ) \sin (c+d x)+80 a b \left (4 a^2+5 b^2\right ) \sin (3 (c+d x))+60 \left (8 a^4+36 a^2 b^2+5 b^4\right ) (c+d x)+15 \left (16 a^4+96 a^2 b^2+15 b^4\right ) \sin (2 (c+d x))+48 a b^3 \sin (5 (c+d x))+5 b^4 \sin (6 (c+d x))}{960 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.81, size = 150, normalized size = 0.64 \[ \frac {15 \, {\left (8 \, a^{4} + 36 \, a^{2} b^{2} + 5 \, b^{4}\right )} d x + {\left (40 \, b^{4} \cos \left (d x + c\right )^{5} + 192 \, a b^{3} \cos \left (d x + c\right )^{4} + 640 \, a^{3} b + 512 \, a b^{3} + 10 \, {\left (36 \, a^{2} b^{2} + 5 \, b^{4}\right )} \cos \left (d x + c\right )^{3} + 64 \, {\left (5 \, a^{3} b + 4 \, a b^{3}\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (8 \, a^{4} + 36 \, a^{2} b^{2} + 5 \, b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.60, size = 168, normalized size = 0.71 \[ \frac {b^{4} \sin \left (6 \, d x + 6 \, c\right )}{192 \, d} + \frac {a b^{3} \sin \left (5 \, d x + 5 \, c\right )}{20 \, d} + \frac {1}{16} \, {\left (8 \, a^{4} + 36 \, a^{2} b^{2} + 5 \, b^{4}\right )} x + \frac {3 \, {\left (4 \, a^{2} b^{2} + b^{4}\right )} \sin \left (4 \, d x + 4 \, c\right )}{64 \, d} + \frac {{\left (4 \, a^{3} b + 5 \, a b^{3}\right )} \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {{\left (16 \, a^{4} + 96 \, a^{2} b^{2} + 15 \, b^{4}\right )} \sin \left (2 \, d x + 2 \, c\right )}{64 \, d} + \frac {{\left (6 \, a^{3} b + 5 \, a b^{3}\right )} \sin \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.05, size = 174, normalized size = 0.74 \[ \frac {b^{4} \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )+\frac {4 a \,b^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+6 a^{2} b^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {4 a^{3} b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+a^{4} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.58, size = 170, normalized size = 0.72 \[ \frac {240 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{4} - 1280 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{3} b + 180 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2} b^{2} + 256 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} a b^{3} - 5 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 60 \, d x - 60 \, c - 9 \, \sin \left (4 \, d x + 4 \, c\right ) - 48 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{4}}{960 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.84, size = 214, normalized size = 0.91 \[ \frac {a^4\,x}{2}+\frac {5\,b^4\,x}{16}+\frac {9\,a^2\,b^2\,x}{4}+\frac {a^4\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {15\,b^4\,\sin \left (2\,c+2\,d\,x\right )}{64\,d}+\frac {3\,b^4\,\sin \left (4\,c+4\,d\,x\right )}{64\,d}+\frac {b^4\,\sin \left (6\,c+6\,d\,x\right )}{192\,d}+\frac {5\,a\,b^3\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {a^3\,b\,\sin \left (3\,c+3\,d\,x\right )}{3\,d}+\frac {a\,b^3\,\sin \left (5\,c+5\,d\,x\right )}{20\,d}+\frac {3\,a^2\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d}+\frac {3\,a^2\,b^2\,\sin \left (4\,c+4\,d\,x\right )}{16\,d}+\frac {5\,a\,b^3\,\sin \left (c+d\,x\right )}{2\,d}+\frac {3\,a^3\,b\,\sin \left (c+d\,x\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 4.02, size = 459, normalized size = 1.95 \[ \begin {cases} \frac {a^{4} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {a^{4} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {a^{4} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {8 a^{3} b \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {4 a^{3} b \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {9 a^{2} b^{2} x \sin ^{4}{\left (c + d x \right )}}{4} + \frac {9 a^{2} b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{2} + \frac {9 a^{2} b^{2} x \cos ^{4}{\left (c + d x \right )}}{4} + \frac {9 a^{2} b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} + \frac {15 a^{2} b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{4 d} + \frac {32 a b^{3} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {16 a b^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {4 a b^{3} \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} + \frac {5 b^{4} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac {15 b^{4} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {15 b^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac {5 b^{4} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac {5 b^{4} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{16 d} + \frac {5 b^{4} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} + \frac {11 b^{4} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} & \text {for}\: d \neq 0 \\x \left (a + b \cos {\relax (c )}\right )^{4} \cos ^{2}{\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________